/**
 * @file socket_msg.h
 * @author HaoyuWang (136046355@qq.com)
 * @brief 封装socket msg
 * @version 0.1
 * @date 2025-02-11
 * 
 * @copyright Copyright (c) 2025
 * 
 */
#ifndef __SOCKET_MSG_H__
#define __SOCKET_MSG_H__

#include "base_msg.h"

class SocketAcceptMsg: public BaseMsg
{
public:
    SocketAcceptMsg();
    ~SocketAcceptMsg();

    inline void SetListenFd(int fd){
        listen_fd_ = fd;
    }
    inline int GetListenFd(){
        return listen_fd_;
    }

    inline void SetCliFd(int fd){
        cli_fd_ = fd;
    }
    inline int GetCliFd(){
        return cli_fd_;
    }

public:
    int listen_fd_;
    int cli_fd_;
};


class SocketRWMsg: public BaseMsg
{
public:
    SocketRWMsg();
    ~SocketRWMsg();

    inline void SetFd(int fd){
        fd_ = fd;
    }
    inline int GetFd(){
        return fd_;
    }

    inline void SetRead(bool is_read){
        is_read_ = is_read;
    }
    inline bool IsRead(){
        return is_read_;
    }

    inline void SetWrite(bool is_write){
        is_write_ = is_write;
    }
    inline bool IsWrite(){
        return is_write_;
    }

    inline void SetClose(bool is_close){
        is_close_ = is_close;
    }
    inline bool IsClose(){
        return is_close_;
    }

public:
    int fd_;
    int is_read_ = false;
    int is_write_ = false;
    int is_close_ = false;
};


#endif  // __SOCKET_MSG_H__